<?php
namespace Food\Widget;

class FoodWidget extends \Common\Controller\BaseController {

	public function run($map=array(),$limit=10){
		$Food=D('FoodView');

		// 进行分页数据查询 注意limit方法的参数要使用Page类的属性
		$list = $Food->where($map)->limit($limit)->order('fid desc')->select();

		$data = array(
			'list'  => $list,
		);
		$this->assign($data);
		$this->template('Food@Widget/list');
	}

	public function wap($map=array(),$limit=10){
		$Food=D('FoodView');

		// 进行分页数据查询 注意limit方法的参数要使用Page类的属性
		$list = $Food->where($map)->limit($limit)->order('fid desc')->select();

		$data = array(
			'list'  => $list,
		);
		$this->assign($data);
		$this->template('Food@wap/list');
	}
}